home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / doom / quake2.zip / ADVQCC.ZIP / CMDLIB.H < prev    next >
C/C++ Source or Header  |  1996-09-25  |  2KB  |  83 lines

  1. // cmdlib.h
  2.  
  3. #ifndef __CMDLIB__
  4. #define __CMDLIB__
  5.  
  6. #include <fcntl.h>
  7. // #include <unistd.h>
  8. #include <fcntl.h>
  9. #include <stdio.h>
  10. #include <string.h>
  11. #include <stdlib.h>
  12. #include <errno.h>
  13. #include <ctype.h>
  14. #include <sys/types.h>
  15. #include <sys/stat.h>
  16. // #include <sys/file.h>
  17. #include <io.h>
  18. #include <stdarg.h>
  19.  
  20. #ifdef NeXT
  21. #include <libc.h>
  22. #endif
  23.  
  24. #ifndef __BYTEBOOL__
  25. #define __BYTEBOOL__
  26. typedef enum {false, true} boolean;
  27. typedef unsigned char byte;
  28. #endif
  29.  
  30. // the dec offsetof macro doesn't work very well...
  31. #define myoffsetof(type,identifier) ((size_t)&((type *)0)->identifier)
  32.  
  33.  
  34. // set these before calling CheckParm
  35. extern int myargc;
  36. extern char **myargv;
  37.  
  38. char *strupr (char *in);
  39. char *strlower (char *in);
  40. //int filelength (int handle);
  41. //int tell (int handle);
  42.  
  43. double I_FloatTime (void);
  44.  
  45. void    Error (char *error, ...);
  46. int        CheckParm (char *check);
  47.  
  48. int     SafeOpenWrite (char *filename);
  49. int     SafeOpenRead (char *filename);
  50. void     SafeRead (int handle, void *buffer, long count);
  51. void     SafeWrite (int handle, void *buffer, long count);
  52. void     *SafeMalloc (long size);
  53.  
  54. long    LoadFile (char *filename, void **bufferptr);
  55. void    SaveFile (char *filename, void *buffer, long count);
  56.  
  57. void     DefaultExtension (char *path, char *extension);
  58. void     DefaultPath (char *path, char *basepath);
  59. void     StripFilename (char *path);
  60. void     StripExtension (char *path);
  61.  
  62. void     ExtractFilePath (char *path, char *dest);
  63. void     ExtractFileBase (char *path, char *dest);
  64. void    ExtractFileExtension (char *path, char *dest);
  65.  
  66. long     ParseNum (char *str);
  67.  
  68. short    BigShort (short l);
  69. short    LittleShort (short l);
  70. long    BigLong (long l);
  71. long    LittleLong (long l);
  72. float    BigFloat (float l);
  73. float    LittleFloat (float l);
  74.  
  75. char *COM_Parse (char *data);
  76.  
  77. extern    char    com_token[1024];
  78. extern    int        com_eof;
  79.  
  80.  
  81.  
  82. #endif
  83.